﻿using Entity.WMS.DTO.WarehouseReal;
using Entity.WMS.View.WarehouseReal;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Service.WMS;

namespace AnQinManagermentBackendAPI.Controller.WMS
{
    /// <summary>
    /// 实时库存表
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    [Authorize]
    public class WarehouseRealController : ControllerBase
    {
        /**
         * 实时库存业务接口
         */
        private readonly WarehouseRealService _warehouseRealService;

        /**
         * 构造函数注入
         */
        public WarehouseRealController(WarehouseRealService warehouseRealService)
        {
            _warehouseRealService = warehouseRealService;
        }

        /// <summary>
        /// 获取库存业务列表
        /// </summary>
        /// <param name="warehouseRealSearchDTO"></param>
        [HttpGet]
        [ProducesResponseType(typeof(WarehouseRealView), 200)]
        public async Task<IActionResult> GetWarehouseRealList([FromQuery] WarehouseRealSearchDTO warehouseRealSearchDTO)
        {
            var response = await _warehouseRealService.GetWarehouseRealList(warehouseRealSearchDTO);
            return StatusCode(response.Status, response);
        }
    }
}
